package com.drakulo.hi.gfx;

import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;

/**
 * <b>Graphic component</b>
 * <p>
 * All graphical components MUST implement this interface
 * </p>
 */
public interface HIGraphicComponent {
	/**
	 * Tests if the mouse is on the component
	 * 
	 * @param mouseX
	 *            - mouse coordinate
	 * @param mouseY
	 *            - mouse coordinate
	 * @return true if the mouse is on the component
	 */
	public boolean mouseIsOnIt(int mouseX, int mouseY);

	/**
	 * Render the component at a static position defined by the component itself
	 * 
	 * @param g
	 *            - the canvas
	 * @throws SlickException
	 */
	public void render(Graphics g) throws SlickException;

	/**
	 * Render the component at the specified position
	 * 
	 * @param g
	 *            - the canvas
	 * @param x
	 *            - the X coordinate
	 * @param y
	 *            - the Y coordinate
	 * @throws SlickException
	 */
	public void render(Graphics g, int x, int y) throws SlickException;

	/**
	 * Perform an update on the component from player input
	 * 
	 * @param input
	 *            - player's input
	 */
	public void update(Input input) throws SlickException;
}
